#include<stdio.h>
#include<string.h>
#define N 1000
int count(char s[N]) 
{
	int i;
	int zimu=0,shuzi=0,kongge=0,sum=0;
	for (i=0;s[i]!='\0';i++) 
	{
		if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z') 
		{
			zimu++;
		}
		if(s[i]>='0'&&s[i]<='9') 
		{
			shuzi++;
		}
		if(s[i]==' ') 
		{
			kongge++;
		}
	}
sum=strlen(s)-zimu-shuzi-kongge;
	printf("%d %d %d %d\n",zimu,shuzi,kongge,sum);
}
int main () 
{
	char str[N];
	while(gets(str)!=NULL)
	{
		count(str);
	}
	
}

